package shop;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;

import java.io.IOException;


@EnableJpaRepositories(basePackages={"shop"})
@SpringBootApplication
@EntityScan("shop")
@EnableDiscoveryClient
public class ProductApplication {

    public static void main(String[] args) throws IOException {
       // SpringApplication.run(ProductApplication.class,args);
        //System.in.read();

        ApplicationContext applicationContext = SpringApplication.run(ProductApplication.class, args);
        Environment env = applicationContext.getEnvironment();
        String name = env.getProperty("mytest.name");
        System.out.println("----run env："+name+"----");


    }
}
